export interface Paginator {
  //  @int32
  page: number;
  //  @int32
  size: number;
}

// 用户
export interface User {
  //  @int32
  user_id: number;
  username: string;
  email: string;
  roles: Role[];
  create_time: string;
}

// 角色
export interface Role {
  //  @int32
  id: number;
  // 角色名称
  code: string;
  name: string;
}

// 物品
export interface Product {
  //  @int32
  id: number;
  product_name: string;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
}

// 物品种类
export interface Category {
  //  @int32
  id: number;
  category_name: string;
  // 1-耗材, 2-非耗材 @int32
  type: number;
}

// 合作方
export interface Supplier {
  //  @int32
  supplier_id: number;
  supplier_name: string;
  contact: string;
  // 合作条件
  cooperation_conditions: string;
}

// 采购订单
export interface PurchaseOrder {
  //  @int32
  order_id: number;
  //  @int32
  product_id: number;
  //  @int32
  supplier_id: number;
  //  @int32
  quantity: number;
  // 1-待交付,2-运输中,3-已送达 @int32
  delivery_progress: number;
  // 1-待付款,2-已付款 @int32
  payment_status: number;
}

// 采购通知
export interface PurchaseNotification {
  //  @int64
  notification_id: string;
  // 物品id @int32
  product_id: number;
  // 接收人id @int32
  recipient_id: number;
  // 采购数量 @int32
  quantity: number;
}

// 归还申请
export interface ReturnApplication {
  //  @int64
  application_id: string;
  // 物品ID @int32
  product_id: number;
  // 归还人id @int32
  applicant_id: number;
  // 归还数量 @int32
  quantity: number;
  // 1-待归还,2-审核中,3-已归还 @int32
  return_status: number;
}

export interface LoginReq {
  email: string;
  password: string;
}

export interface LoginResp {
  token: string;
  //  @int32
  user_id: number;
  // admin(系统管理员)，purchaser（采购人员），m-admin（物资管理员），picker（领物），visitor（游客）
  role_code: string;
}

export interface RegisterReq {
  // 必填
  username: string;
  // 必填
  email: string;
  // 必填
  password: string;
}

export interface RegisterResp {
  token: string;
  //  @int32
  user_id: number;
  // 注册后都是游客，需要管理员分配角色
  role_code: string;
}

export interface LogoutReq {}

export interface LogoutResp {}

export interface CreateUserReq {
  // 必填
  username: string;
  // 必填
  email: string;
  // 必填
  password: string;
  // 必填
  role_code: string;
}

export interface CreateUserResp {}

export interface DeleteUserReq {
  //  @int32
  user_id: number;
}

export interface DeleteUserResp {}

export interface ResetPasswordReq {
  //  @int32
  user_id: number;
}

export interface ResetPasswordResp {
  // 重置后的密码（弹框提示，可复制）
  password: string;
}

export interface ModifyPasswordReq {
  //  @int32
  user_id: number;
  old_password: string;
  new_password: string;
}

export interface ModifyPasswordResp {}

export interface UpdateUserRoleReq {
  //  @int32
  user_id: number;
  //  @int32
  role_id: number;
}

export interface UpdateUserRoleResp {}

export interface ListUsersReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
  role_id: number;
}

export interface ListUsersResp {
  //  @int32
  total: number;
  users: User[];
}

export interface GetUserReq {
  //  @int32
  user_id: number;
}

export interface GetUserResp {
  user: User;
}

export interface ListRolesReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
}

export interface ListRolesResp {
  //  @int32
  total: number;
  roles: Role[];
}

export interface CreateProductReq {
  product_name: string;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
}

export interface CreateProductResp {}

export interface UpdateProductReq {
  product: Product;
}

export interface UpdateProductResp {}

export interface DeleteProductReq {
  //  @int32
  product_id: number;
}

export interface DeleteProductResp {}

export interface ListProductsReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
  warehouse_id: number;
}

export interface ListProductsResp {
  //  @int32
  total: number;
  products: Product[];
}

export interface CreateCategoryReq {
  category_name: string;
  // 1-耗材, 2-非耗材 @int32
  type: number;
}

export interface CreateCategoryResp {}

export interface UpdateCategoryReq {
  category: Category;
}

export interface UpdateCategoryResp {}

export interface DeleteCategoryReq {
  //  @int32
  category_id: number;
}

export interface DeleteCategoryResp {}

export interface ListCategoriesReq {
  page: number;
  size: number;
}

export interface ListCategoriesResp {
  //  @int32
  total: number;
  categories: Category[];
}

export interface CreateSupplierReq {
  supplier_name: string;
  contact: string;
  // 合作条件
  cooperation_conditions: string;
}

export interface CreateSupplierResp {}

export interface UpdateSupplierReq {
  supplier: Supplier;
}

export interface UpdateSupplierResp {}

export interface DeleteSupplierReq {
  //  @int32
  supplier_id: number;
}

export interface DeleteSupplierResp {}

export interface ListSuppliersReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
}

export interface ListSuppliersResp {
  //  @int32
  total: number;
  suppliers: Supplier[];
}

export interface CreatePurchaseOrderReq {
  //  @int32
  product_id: number;
  //  @int32
  supplier_id: number;
  //  @int32
  quantity: number;
  // 1-待交付,2-运输中,3-已送达 @int32
  delivery_progress: number;
  // 1-待付款,2-已付款 @int32
  payment_status: number;
}

export interface CreatePurchaseOrderResp {}

export interface UpdatePurchaseOrderReq {
  purchase_order: PurchaseOrder;
}

export interface UpdatePurchaseOrderResp {}

export interface DeletePurchaseOrderReq {
  //  @int32
  purchase_order_id: number;
}

export interface DeletePurchaseOrderResp {}

export interface ListPurchaseOrdersReq {
  page: number;
  size: number;
}

export interface ListPurchaseOrdersResp {
  //  @int32
  total: number;
  purchase_order: PurchaseOrder[];
}

export interface CreatePurchaseNotificationReq {
  // 商品 @int32
  product_id: number;
  // 接收人id @int32
  recipient_id: number;
  // 采购数量 @int32
  quantity: number;
}

export interface CreatePurchaseNotificationResp {}

export interface ListPurchaseNotificationReq {
  page: number;
  size: number;
  recipient_id?: number;
  // int32 recipient_id = 3; // 接收人id(采购人员), 当前登陆采购人员只能看到自己的采购通知
}

export interface ListPurchaseNotificationResp {
  //  @int32
  total: number;
  purchase_notification: PurchaseNotification[];
}

export interface CreateReturnApplicationReq {
  // 物品ID @int32
  product_id: number;
  // 归还人id @int32
  applicant_id: number;
  // 归还数量 @int32
  quantity: number;
  // 1-待归还,2-审核中,3-已归还 @int32
  return_status: number;
}

export interface CreateReturnApplicationResp {}

export interface UpdateReturnApplicationStatusReq {
  //  @int64
  application_id: string;
  // 1-待归还,2-审核中,3-已归还 @int32
  return_status: number;
}

export interface UpdateReturnApplicationStatusResp {}

export interface ListReturnApplicationsReq {
  paginator: Paginator;
}

export interface ListReturnApplicationsResp {
  //  @int32
  total: number;
  return_application: ReturnApplication[];
}

export interface CreateApplicationReq {
  // 物品ID, 必填 @int32
  product_id: number;
  // 申请人id，必填 @int32
  user_id: number;
  // 申请类型：1-借出 2-归还 @int32
  application_type: number;
  // 预计归还日期， 日期格式 2024-03-04，必填
  expected_return_date: string;
  // 备注
  remarks: string;
}

export interface CreateApplicationResp {}

export interface UpdateApplicationStatusReq {
  //  @int64
  application_id: string;
  // 1-待处理，2-已处理（更新到这个状态即可） @int32
  status: number;
}

export interface UpdateApplicationStatusResp {}

export interface ListApplicationsReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
  administrator_id?: number;
  applicant_id?: number;
}
// 申请
export interface Application {
  //  @int32
  id: number;
  // 物品ID @int32
  product_id: number;
  // 申请人id @int32
  user_id: number;
  // 申请类型：1-借出 2-归还 @int32
  application_type: number;
  // 申请时间
  application_date: string;
  // 预计归还日期， 日期格式 2024-03-04，必填
  expected_return_date: string;
  // 1-待处理 2-已处理 @int32
  status: number;
  // 备注
  remarks: string;
  // 物品名称
  product_name: string;
  // 申请人名称
  user_name: string;
}
export interface ListApplicationsResp {
  //  @int32
  total: number;
  applications: Application[];
}

export interface CreateWarehouseReq {
  warehouse_name: string;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
}

export interface CreateWarehouseResp {}

export interface UpdateWarehouseReq {
  //  @int32
  warehouse_id: number;
  warehouse_name: string;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
}

export interface UpdateWarehouseResp {}

export interface DeleteWarehouseReq {
  //  @int32
  warehouse_id: number;
}

export interface DeleteWarehouseResp {}

export interface ListWarehousesReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
}

export interface ListWarehousesResp {
  //  @int32
  total: number;
  warehouses: Warehouse[];
}

export interface CreateWarehouseRecordReq {
  //  @int32
  product_id: number;
  //  @int32
  warehouse_id: number;
  // 1-入库 2-出库 @int32
  operation_type: number;
  // 数量 @int32
  quantity: number;
}

export interface CreateWarehouseRecordResp {}

export interface UpdateWarehouseRecordReq {
  //  @int32
  record_id: number;
  //  @int32
  product_id: number;
  //  @int32
  warehouse_id: number;
  // 1-入库 2-出库 @int32
  operation_type: number;
  // 数量 @int32
  quantity: number;
}

export interface UpdateWarehouseRecordResp {}

export interface DeleteWarehouseRecordReq {
  //  @int32
  record_id: number;
}

export interface DeleteWarehouseRecordResp {}

export interface ListWarehouseRecordsReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
}

export interface ListWarehouseRecordsResp {
  //  @int32
  total: number;
  warehouse_records: WarehouseRecord[];
}

// 仓库
export interface WarehouseRecord {
  //  @int32
  id: number;
  //  @int32
  product_id: number;
  //  @int32
  warehouse_id: number;
  // 1-入库 2-出库 @int32
  operation_type: number;
  // 数量 @int32
  quantity: number;
  // 物品名称
  product_name: string;
  // 仓库名称
  warehouse_name: string;
}

// 仓库记录
export interface Warehouse {
  //  @int32
  id: number;
  warehouse_name: string;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
  // bool remind = 5; // 是否提醒
  remind: boolean;
}

export interface WarehouseProduct {
  //  @int32
  id: number;
  //  @int32
  product_id: number;
  //  @int32
  warehouse_id: number;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
  // 是否提醒 @bool
  remind: boolean;
  warehouse_name: string;
  product_name: string;
}

export interface ListWarehouseProductsReq {
  //  @int32
  page: number;
  //  @int32
  size: number;
  // 筛选项 @int32
  product_id: number;
  // 仓库id @int32
  warehouse_id: number;
}

export interface ListWarehouseProductsResp {
  //  @int32
  total: number;
  warehouse_products: WarehouseProduct[];
}

export interface CreateWarehouseProductReq {
  //  @int32
  product_id: number;
  //  @int32
  warehouse_id: number;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
}

export interface CreateWarehouseProductResp {}

export interface UpdateWarehouseProductReq {
  //  @int32
  warehouse_product_id: number;
  //  @int32
  product_id: number;
  //  @int32
  warehouse_id: number;
  // 库存 @int32
  inventory: number;
  // 提醒阈值 @int32
  reminder_threshold: number;
}

export interface UpdateWarehouseProductResp {}

export interface DeleteWarehouseProductReq {
  //  @int32
  warehouse_product_id: number;
}

export interface DeleteWarehouseProductResp {}
